package cn.yunhe.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.yunhe.entity.Drug;
import cn.yunhe.entity.ShuJu;
import cn.yunhe.service.ShuJuService;
@Controller
public class ShuJuController {
	@Autowired
	private ShuJuService shuJuService;
	
	
	@RequestMapping("/selectShuJu")
	private String selectShuJu( HttpServletRequest request){
		List<ShuJu> shuju= shuJuService.selectShuJu();
	   request.setAttribute("shuju", shuju);
		return "ShuJu";
		
	}
	@RequestMapping("/selectMoHuShuJu")
	private String selectMuHuShuJu( HttpServletRequest request,String rbname){
		System.out.println(rbname+"222222222222222");
		List<ShuJu> shuju= shuJuService.selectMoHuShuJu(rbname);
		for (ShuJu s : shuju) {
			System.out.println(s.getRbname());
		}
	   request.setAttribute("shuju", shuju);
		return "ShuJuMoHu";
		
	}
	public ShuJuService getShuJuService() {
		return shuJuService;
	}

	public void setShuJuService(ShuJuService shuJuService) {
		this.shuJuService = shuJuService;
	}
	
	
	
}
